package com.shanzmoo.db.personnel.entity.dto;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.personnel.entity.MemberAddressEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 用户地址更新对象
 *
 * @author Gzhao 2021/1/4
 */
@Data
@ApiModel("用户地址更新对象")
public class MemberAddressUpdateDto extends MemberAddressSaveDto {

    private static final long serialVersionUID = 1758L;

    @NotBlank(message = "地址id不允许为空")
    @ApiModelProperty(value = "地址id")
    private Integer id;

    public MemberAddressEntity convert() {
        return JSON.parseObject(JSON.toJSONString(this), MemberAddressEntity.class);
    }
}
